#include "HttpVistor.h"

#include "./include/curl/easy.h"


HttpVistor* HttpVistor::instance_ = HttpVistor::getInstance();

HttpVistor::HttpVistor()
          : curl_(NULL) {
  curl_global_init(CURL_GLOBAL_ALL);
  curl_ = curl_easy_init();
}

HttpVistor::~HttpVistor()
{
  if (curl_ != NULL) {
    curl_easy_cleanup(curl_);
  }

}

static HttpVistor* HttpVistor::getInstance() {
  static HttpVistor instance;
  return &instance;
}